package cn.z2huo.demo.log.aop.web.controller;

import cn.z2huo.demo.log.aop.web.annotation.Log;
import cn.z2huo.demo.log.aop.web.enums.FunctionModuleEnum;
import cn.z2huo.demo.model.dataobject.user.UserDO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *
 * @author z2huo
 */
@Slf4j
@RestController
@RequestMapping("/user")
public class UserController {

    @Log(title = "添加单个用户", module = FunctionModuleEnum.USER_MANAGE)
    @PostMapping("/add")
    public String add(@RequestBody UserDO userDO) {
        log.info("add API 调用, userCode is {}, userName is {}", userDO.getUserCode(), userDO.getUserName());
        return "新增用户成功";
    }

}
